﻿using System;
using System.Collections.Generic;
using System.Drawing;

namespace System
{
	
	public partial class Poly3G
	{
		public void Draw(Graphics G)
		{
			G.TranslateTransform(G.VisibleClipBounds.Width / 2, G.VisibleClipBounds.Height / 2);
			G.ScaleTransform(10, -10);
			List<PointF> P = new List<PointF>();
			for (int i = 0; i < Points.Count; i++)
				P.Add(new PointF((float)Points[i].Longitude, (float)Points[i].Latitude));
			G.DrawPolygon(new Pen(Color.Red, 0.3f), P.ToArray());
			for (int i = 0; i < Triangles.Count; i++)
				G.DrawPolygon(new Pen(Color.Black, 0.1f), new PointF[]{
					new PointF((float)Triangles[i].A.Longitude,(float)Triangles[i].A.Latitude),new PointF((float)Triangles[i].B.Longitude,(float)Triangles[i].B.Latitude),new PointF((float)Triangles[i].C.Longitude,(float)Triangles[i].C.Latitude)});
			G.ResetTransform();
		}
	}
}